package org.bw.bookstore.common.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

/**
 *@program: wisdom_bookstore
 *@description: 书籍和书籍类型中间表
 *@Author: 孙冬雪
 *@Date: 2020-10-22 09:50
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Entity
@TableName("rl_book_and_type")
public class RlBookAndType extends BaseEntity implements Serializable {

    /**
     * 图书详情标识
     * @Author 孙冬雪
     * @Date 2020/10/21 14:09
     **/
    private String bookDetailedCode;

    /**
     * 图书类型标识
     * @Author 孙冬雪
     * @Date 2020/10/21 14:09
     **/
    private String bookTypeCode;

    /**
     * 一个图书-类型中间表有多个图书详情产生
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 16:06
     **/
    @TableField(exist = false)
    @Transient
    private List<TbBookDetailed> bookDetailedList;

    /**
     * 一个图书-类型中间表有多个图书类型产生
     * @Author 孙冬雪
     * @Date 2020/10/21 16:08
     **/
    @TableField(exist = false)
    @Transient
    private List<TbBookType> tbBookTypeList;
}
